// 路由配置步骤：

import { createRouter, createWebHashHistory } from "vue-router";
import AppHome from "@/pages/Home/AppHome.vue";
import AppSearch from "@/pages/Search/AppSearch.vue";
import AppFooter from "@/pages/Layout/AppFooter.vue";
import AppCart from "@/pages/Cart/AppCart.vue";
import AppMine from "@/pages/Mine/AppMine.vue";
import AppList from "@/pages/List/AppList.vue"

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    { path: '/', redirect: { name: 'home' } },
    // 该components写法是去除页面下面的footer
    { path: '/home', name: 'home', components: {default: AppHome,footer: AppFooter} },
    { path: '/search', name: 'search', component: AppSearch },
    { path: '/list', name: 'list', components: {default: AppList,footer: AppFooter} },
    { path: '/cart', name: 'cart', components: {default: AppCart,footer: AppFooter} },
    { path: '/mine', name: 'mine', components: {default: AppMine,footer: AppFooter} },
  ]
})

export default router